/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.genbusiness.data;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 *
 * @author Johann
 */
public class CAD {
    private static Connection connection = null;
    
    public static Connection getConnection() {
        if (connection == null) {
            //Connection BDD
            String url = "jdbc:mysql://10.67.126.93:3306/";
            //String url = "jdbc:mysql://localhost:3306/";
            String dbName = "dico";
            String driver = "com.mysql.jdbc.Driver";
            String userName = "root";
            String password = "";
            try {
                Class.forName(driver).newInstance();
                connection = DriverManager.getConnection(url + dbName, userName, password);
            } catch (Exception e) {
                e.printStackTrace();
            }
            return connection;
        } else {
            return connection;
        }
    }
}
